package com.rattsoftware.server.service;

import java.util.List;

import com.rattsoftware.server.admin.model.Faculty;
import com.rattsoftware.server.admin.model.exceptions.RattsSecurityException;
import com.rattsoftware.server.admin.model.paging.PagingLoadConfig;
import com.rattsoftware.server.admin.model.paging.PagingLoadResult;

public interface FacultyService {

	/**
     * Gets a faculty based on its name
     * @param name String faculty name
     * @return Faculty, or null if no match found
     * @throws RattsSecurityException For any <tt>security related</tt> that occurs on the <tt>service layer.</tt>
     */
	Faculty getFaculty(String name) throws RattsSecurityException;  
	
	/**
	 * Fetches all the system <tt>Faculties.</tt>
	 * 
	 * @return <tt>List</tt> of <tt>Faculties.</tt>
	 * @throws RattsSecurityException For any <tt>security related</tt> that occurs on the <tt>service layer.</tt>
	 */
	List<Faculty> getFaculties() throws RattsSecurityException;
	
	/**
	 * Saves a dirty or new <tt>Role</tt>.
	 * 
	 * @param faculty <tt>Faculty</tt> to save.
	 * @throws RattsSecurityException For any <tt>security related</tt> that occurs on the <tt>service layer.</tt>
	 */
	void saveFaculty(Faculty faculty) throws RattsSecurityException;
	
	/**
	 * Deletes a given <tt>Faculty</tt>.
	 * 
	 * @param role <tt>Faculty</tt> to delete.
	 * @throws RattsSecurityException For any <tt>security related</tt> that occurs on the <tt>service layer.</tt>
	 */
	void deleteFaculty(Faculty faculty) throws RattsSecurityException;
	
	/**
	 * Persists a given list of faculties to the database.
	 * 
	 * @param faculties List of faculties to persist.
	 */
	void saveFaculties(List<Faculty> faculties) throws RattsSecurityException;
	
	/**
	 * Retrieves a page of the Faculty data.
	 * 
	 * @param pagingLoadConfig
	 *            config to specify paging related config
	 * @return PagingLoadResult containing a page of Faculty data
	 */
	PagingLoadResult<Faculty> getFacultyList( PagingLoadConfig pagingLoadConfig) throws RattsSecurityException;
}
